package edu.vo.ID;

import java.io.Serializable;
import java.util.Objects;

// 实现 Serializable 接口
public class ScoreId implements Serializable {
    private Integer student;
    private Integer course;

    // 构造函数
    public ScoreId() {}

    public ScoreId(Integer student, Integer course) {
        this.student = student;
        this.course = course;
    }

    // Getters 和 Setters
    public Integer getStudent() {
        return student;
    }

    public void setStudent(Integer student) {
        this.student = student;
    }

    public Integer getCourse() {
        return course;
    }

    public void setCourse(Integer course) {
        this.course = course;
    }

    // 重写 equals 方法
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ScoreId scoreId = (ScoreId) o;
        return Objects.equals(student, scoreId.student) &&
                Objects.equals(course, scoreId.course);
    }

    // 重写 hashCode 方法
    @Override
    public int hashCode() {
        return Objects.hash(student, course);
    }
}